<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: Ensembl::Core::SeqRegion</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (S)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../Ensembl.html" title="Ensembl (module)">Ensembl</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Core.html" title="Ensembl::Core (module)">Core</a></span></span>
     &raquo; 
    <span class="title">SeqRegion</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Ensembl::Core::SeqRegion
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">ActiveRecord::Base</li>
          
            <li class="next"><span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></li>
          
            <li class="next"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></li>
          
            <li class="next">Ensembl::Core::SeqRegion</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/ensembl/core/activerecord.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion class describes a part of a coordinate systems. It is an
interface to the seq_region table of the Ensembl mysql database.
</p>
<p>
This class uses ActiveRecord to access data in the Ensembl database. See
the general documentation of the Ensembl module for more information on
what this means and what methods are available.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code"><span class='chr4 identifier id'>chr4</span> <span class='assign token'>=</span> <span class='SeqRegion constant id'>SeqRegion</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='string val'>'4'</span><span class='rparen token'>)</span>
<span class='puts identifier id'>puts</span> <span class='chr4 identifier id'>chr4</span><span class='dot token'>.</span><span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='name identifier id'>name</span>     <span class='comment val'>#--&gt; 'chromosome'</span>
<span class='chr4 identifier id'>chr4</span><span class='dot token'>.</span><span class='genes identifier id'>genes</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='gene identifier id'>gene</span><span class='bitor op'>|</span>
<span class='puts identifier id'>puts</span> <span class='gene identifier id'>gene</span><span class='dot token'>.</span><span class='biotype identifier id'>biotype</span>
<span class='end end kw'>end</span>
</pre>
    
  </div>

</div>

  
  
  
  
  
  
  
  
  

  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#assembled_seq_regions-instance_method" title="#assembled_seq_regions (instance method)">- (Array&lt;SeqRegion&gt;) <strong>assembled_seq_regions</strong>(coord_system_name = nil) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The SeqRegion#assembled_seq_regions returns the sequence regions on which
the current region is assembled.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#assembly_links_as_assembly-instance_method" title="#assembly_links_as_assembly (instance method)">- (Array&lt;AssemblyLink&gt;) <strong>assembly_links_as_assembly</strong>(coord_system = nil) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
This method queries the assembly table to find those rows (i.e.
AssemblyLink objects) for which this seq_region is the assembly.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#assembly_links_as_component-instance_method" title="#assembly_links_as_component (instance method)">- (Array&lt;AssemblyLink&gt;) <strong>assembly_links_as_component</strong>(coord_system = nil) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
This method queries the assembly table to find those rows (i.e.
AssemblyLink objects) for which this seq_region is the component.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#component_seq_regions-instance_method" title="#component_seq_regions (instance method)">- (Array&lt;SeqRegion&gt;) <strong>component_seq_regions</strong>(coord_system_name = nil) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The SeqRegion#component_seq_regions returns the sequence regions contained
within the current region (in other words: the bits used to assemble the
current region).
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#sequence-instance_method" title="#sequence (instance method)">- (String) <strong>sequence</strong> </a>
    

    
      (also: #seq)
    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The SeqRegion#sequence method returns the sequence of this seq_region.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#slice-instance_method" title="#slice (instance method)">- (Ensembl::Core::Slice) <strong>slice</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The SeqRegion#slice method returns a slice object that covers the whole of
the seq_region.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#subsequence-instance_method" title="#subsequence (instance method)">- (String) <strong>subsequence</strong>(start, stop) </a>
    

    
      (also: #subseq)
    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The SeqRegion#subsequence method returns a subsequence of this seq_region.
</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="DBConnection.html#connect-class_method" title="Ensembl::Core::DBConnection.connect (method)">connect</a></span>, <span class='object_link'><a href="DBConnection.html#ensemblgenomes_connect-class_method" title="Ensembl::Core::DBConnection.ensemblgenomes_connect (method)">ensemblgenomes_connect</a></span></p>

  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="../DBRegistry/Base.html#generic_connect-class_method" title="Ensembl::DBRegistry::Base.generic_connect (method)">generic_connect</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_info-class_method" title="Ensembl::DBRegistry::Base.get_info (method)">get_info</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_name_from_db-class_method" title="Ensembl::DBRegistry::Base.get_name_from_db (method)">get_name_from_db</a></span></p>

  

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="assembled_seq_regions-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="" title="Ensembl::Core::SeqRegion (class)">SeqRegion</a></span>&gt;</tt>) <strong>assembled_seq_regions</strong>(coord_system_name = nil) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion#assembled_seq_regions returns the sequence regions on which
the current region is assembled. For example, calling this method on a
contig sequence region, it might return the chromosome that that contig is
part of. Optionally, this method takes a coordinate system name so that
only regions of that coordinate system are returned.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>coord_system_name</span>
      
      
        <em class="default">(defaults to: <tt>nil</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>
Name of coordinate system
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="" title="Ensembl::Core::SeqRegion (class)">SeqRegion</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Array of SeqRegion objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


400
401
402
403
404
405
406
407
408
409
410
411
412
413</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 400</span>

<span class='def def kw'>def</span> <span class='assembled_seq_regions identifier id'>assembled_seq_regions</span><span class='lparen token'>(</span><span class='coord_system_name identifier id'>coord_system_name</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='coord_system_name identifier id'>coord_system_name</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='asm_seq_regions identifier id'>asm_seq_regions</span>
  <span class='else else kw'>else</span>
    <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
    <span class='coord_system identifier id'>coord_system</span> <span class='assign token'>=</span> <span class='CoordSystem constant id'>CoordSystem</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='coord_system_name identifier id'>coord_system_name</span><span class='rparen token'>)</span>
    <span class='self self kw'>self</span><span class='dot token'>.</span><span class='asm_seq_regions identifier id'>asm_seq_regions</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='asr identifier id'>asr</span><span class='bitor op'>|</span>
      <span class='if if kw'>if</span> <span class='asr identifier id'>asr</span><span class='dot token'>.</span><span class='coord_system_id identifier id'>coord_system_id</span> <span class='eq op'>==</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
        <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='asr identifier id'>asr</span><span class='rparen token'>)</span>
      <span class='end end kw'>end</span>
    <span class='end end kw'>end</span>
    <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="assembly_links_as_assembly-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="AssemblyLink.html" title="Ensembl::Core::AssemblyLink (class)">AssemblyLink</a></span>&gt;</tt>) <strong>assembly_links_as_assembly</strong>(coord_system = nil) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
This method queries the assembly table to find those rows (i.e.
AssemblyLink objects) for which this seq_region is the assembly.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code"><span class='my_seq_region identifier id'>my_seq_region</span> <span class='assign token'>=</span> <span class='SeqRegion constant id'>SeqRegion</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='string val'>'4'</span><span class='rparen token'>)</span>
<span class='first_link identifier id'>first_link</span> <span class='assign token'>=</span> <span class='my_seq_region identifier id'>my_seq_region</span><span class='dot token'>.</span><span class='assembly_links_as_assembly identifier id'>assembly_links_as_assembly</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
<span class='puts identifier id'>puts</span> <span class='first_link identifier id'>first_link</span><span class='dot token'>.</span><span class='asm_start identifier id'>asm_start</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>&quot;\t&quot;</span> <span class='plus op'>+</span> <span class='first_link identifier id'>first_link</span><span class='dot token'>.</span><span class='asm_end identifier id'>asm_end</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><span class='object_link'><a href="CoordSystem.html" title="Ensembl::Core::CoordSystem (class)">CoordSystem</a></span></tt>)</span>
      
      
        <span class='name'>coord_system</span>
      
      
        <em class="default">(defaults to: <tt>nil</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>
Coordinate system object that the components should belong to
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="AssemblyLink.html" title="Ensembl::Core::AssemblyLink (class)">AssemblyLink</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Array of AssemblyLink objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


450
451
452
453
454
455
456
457
458
459</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 450</span>

<span class='def def kw'>def</span> <span class='assembly_links_as_assembly identifier id'>assembly_links_as_assembly</span><span class='lparen token'>(</span><span class='coord_system identifier id'>coord_system</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='SESSION constant id'>SESSION</span><span class='dot token'>.</span><span class='coord_system_ids identifier id'>coord_system_ids</span><span class='dot token'>.</span><span class='has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='name identifier id'>name</span><span class='rparen token'>)</span>
    <span class='coord_system_id identifier id'>coord_system_id</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='SESSION constant id'>SESSION</span><span class='dot token'>.</span><span class='coord_system_ids identifier id'>coord_system_ids</span><span class='lbrack token'>[</span><span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='name identifier id'>name</span><span class='rbrack token'>]</span>
  <span class='else else kw'>else</span>
    <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='SESSION constant id'>SESSION</span><span class='dot token'>.</span><span class='coord_systems identifier id'>coord_systems</span><span class='lbrack token'>[</span><span class='cs identifier id'>cs</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
    <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='SESSION constant id'>SESSION</span><span class='dot token'>.</span><span class='coord_system_ids identifier id'>coord_system_ids</span><span class='lbrack token'>[</span><span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='name identifier id'>name</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
  <span class='end end kw'>end</span>
  <span class='coord_system identifier id'>coord_system</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='SESSION constant id'>SESSION</span><span class='dot token'>.</span><span class='coord_systems identifier id'>coord_systems</span><span class='lbrack token'>[</span><span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='rbrack token'>]</span>
  <span class='return return kw'>return</span> <span class='AssemblyLink constant id'>AssemblyLink</span><span class='dot token'>.</span><span class='find_by_sql identifier id'>find_by_sql</span><span class='lparen token'>(</span><span class='dstring node'>&quot;SELECT * FROM assembly a WHERE a.asm_seq_region_id = #{self.id} AND a.cmp_seq_region_id IN (SELECT sr.seq_region_id FROM seq_region sr WHERE coord_system_id = #{coord_system.id} )&quot;</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="assembly_links_as_component-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="AssemblyLink.html" title="Ensembl::Core::AssemblyLink (class)">AssemblyLink</a></span>&gt;</tt>) <strong>assembly_links_as_component</strong>(coord_system = nil) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
This method queries the assembly table to find those rows (i.e.
AssemblyLink objects) for which this seq_region is the component.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code">
<span class='my_seq_region identifier id'>my_seq_region</span> <span class='assign token'>=</span> <span class='SeqRegion constant id'>SeqRegion</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='string val'>'Chr4.003.1'</span><span class='rparen token'>)</span>
<span class='first_link identifier id'>first_link</span> <span class='assign token'>=</span> <span class='my_seq_region identifier id'>my_seq_region</span><span class='dot token'>.</span><span class='assembly_links_as_component identifier id'>assembly_links_as_component</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
<span class='puts identifier id'>puts</span> <span class='first_link identifier id'>first_link</span><span class='dot token'>.</span><span class='asm_start identifier id'>asm_start</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>&quot;\t&quot;</span> <span class='plus op'>+</span> <span class='first_link identifier id'>first_link</span><span class='dot token'>.</span><span class='asm_end identifier id'>asm_end</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
</pre>
    
  </div>
<h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><span class='object_link'><a href="CoordSystem.html" title="Ensembl::Core::CoordSystem (class)">CoordSystem</a></span></tt>)</span>
      
      
        <span class='name'>coord_system</span>
      
      
        <em class="default">(defaults to: <tt>nil</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>
Coordinate system object that the assembly should belong to
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="AssemblyLink.html" title="Ensembl::Core::AssemblyLink (class)">AssemblyLink</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Array of AssemblyLink objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


473
474
475
476
477
478
479</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 473</span>

<span class='def def kw'>def</span> <span class='assembly_links_as_component identifier id'>assembly_links_as_component</span><span class='lparen token'>(</span><span class='coord_system identifier id'>coord_system</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='asm_links_as_cmp identifier id'>asm_links_as_cmp</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='asm_links_as_cmp identifier id'>asm_links_as_cmp</span><span class='dot token'>.</span><span class='select identifier id'>select</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='alac identifier id'>alac</span><span class='bitor op'>|</span> <span class='alac identifier id'>alac</span><span class='dot token'>.</span><span class='asm_seq_region identifier id'>asm_seq_region</span><span class='dot token'>.</span><span class='coord_system_id identifier id'>coord_system_id</span> <span class='eq op'>==</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='rbrace token'>}</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="component_seq_regions-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="" title="Ensembl::Core::SeqRegion (class)">SeqRegion</a></span>&gt;</tt>) <strong>component_seq_regions</strong>(coord_system_name = nil) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion#component_seq_regions returns the sequence regions contained
within the current region (in other words: the bits used to assemble the
current region). For example, calling this method on a chromosome sequence
region, it might return the contigs that were assembled into this
chromosome. Optionally, this method takes a coordinate system name so that
only regions of that coordinate system are returned.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>coord_system_name</span>
      
      
        <em class="default">(defaults to: <tt>nil</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>
Name of coordinate system
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="" title="Ensembl::Core::SeqRegion (class)">SeqRegion</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Array of SeqRegion objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


424
425
426
427
428
429
430
431
432
433
434
435
436
437</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 424</span>

<span class='def def kw'>def</span> <span class='component_seq_regions identifier id'>component_seq_regions</span><span class='lparen token'>(</span><span class='coord_system_name identifier id'>coord_system_name</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='coord_system_name identifier id'>coord_system_name</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='cmp_seq_regions identifier id'>cmp_seq_regions</span>
  <span class='else else kw'>else</span>
    <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
    <span class='coord_system identifier id'>coord_system</span> <span class='assign token'>=</span> <span class='CoordSystem constant id'>CoordSystem</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='coord_system_name identifier id'>coord_system_name</span><span class='rparen token'>)</span>
    <span class='self self kw'>self</span><span class='dot token'>.</span><span class='cmp_seq_regions identifier id'>cmp_seq_regions</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='csr identifier id'>csr</span><span class='bitor op'>|</span>
      <span class='if if kw'>if</span> <span class='csr identifier id'>csr</span><span class='dot token'>.</span><span class='coord_system_id identifier id'>coord_system_id</span> <span class='eq op'>==</span> <span class='coord_system identifier id'>coord_system</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
        <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='csr identifier id'>csr</span><span class='rparen token'>)</span>
      <span class='end end kw'>end</span>
    <span class='end end kw'>end</span>
    <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="sequence-instance_method">
  
    - (<tt>String</tt>) <strong>sequence</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='seq-instance_method'>seq</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion#sequence method returns the sequence of this seq_region. At
the moment, it will only return the sequence if the region belongs to the
seqlevel coordinate system.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
DNA sequence
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


486
487
488</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 486</span>

<span class='def def kw'>def</span> <span class='sequence identifier id'>sequence</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='dna identifier id'>dna</span><span class='dot token'>.</span><span class='sequence identifier id'>sequence</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="slice-instance_method">
  
    - (<tt><span class='object_link'><a href="Slice.html" title="Ensembl::Core::Slice (class)">Ensembl::Core::Slice</a></span></tt>) <strong>slice</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion#slice method returns a slice object that covers the whole of
the seq_region.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><span class='object_link'><a href="Slice.html" title="Ensembl::Core::Slice (class)">Ensembl::Core::Slice</a></span></tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Slice object
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


388
389
390</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 388</span>

<span class='def def kw'>def</span> <span class='slice identifier id'>slice</span>
  <span class='return return kw'>return</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Slice constant id'>Slice</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="subsequence-instance_method">
  
    - (<tt>String</tt>) <strong>subsequence</strong>(start, stop) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='subseq-instance_method'>subseq</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>
The SeqRegion#subsequence method returns a subsequence of this seq_region.
At the moment, it will only return the sequence if the region belongs to
the seqlevel coordinate system.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>start</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Start position
</p>
</div>
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>stop</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Stop position
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
DNA sequence
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


498
499
500</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 498</span>

<span class='def def kw'>def</span> <span class='subsequence identifier id'>subsequence</span><span class='lparen token'>(</span><span class='start identifier id'>start</span><span class='comma token'>,</span> <span class='stop identifier id'>stop</span><span class='rparen token'>)</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span><span class='dot token'>.</span><span class='slice identifier id'>slice</span><span class='lparen token'>(</span><span class='start identifier id'>start</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='lparen token'>(</span><span class='stop identifier id'>stop</span> <span class='minus op'>-</span> <span class='start identifier id'>start</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Dec 15 19:18:19 2010 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.3 (ruby-1.8.7).
</div>

  </body>
</html>